/// 一级列表
class FirstLevelCategory {
  int id = 0;
  String name = "";
  String ctime = "";
  String utime = "";
  int sortNum = 0;
  int uid = 0;
  int amount = 0;


  FirstLevelCategory({ this.id=0, required this.name, this.ctime="", this.utime="", this.sortNum=0,
    this.uid=0,  this.amount=0});

  FirstLevelCategory.fromJson(dynamic json) {
    id = json['ID'];
    name = json['Name'];
    ctime = json['Ctime'];
    utime = json['Utime'];
    sortNum = json['SortNum'];
    if (sortNum == 0) {
      sortNum = id;
    }
    uid = json['Uid'];
    amount = json['Amount'];
  }

  Map<String, dynamic> toJson() {
    final map = <String, dynamic>{};
    if (id != 0) {
      map['ID'] = id;
    }
    map['Name'] = name;
    map['Ctime'] = ctime;
    map['Utime'] = utime;
    map['SortNum'] = sortNum;
    map['Uid'] = uid;
    map['Amount'] = amount;
    return map;
  }

  Map<String, dynamic> toJsonTest() {
    final map = <String, dynamic>{};
    // map['ID'] = void;
    map['Name'] = name;
    map['Ctime'] = DateTime.now().millisecondsSinceEpoch;
    map['Utime'] = DateTime.now().millisecondsSinceEpoch;
    map['SortNum'] = sortNum;
    map['Uid'] = uid;
    map['Amount'] = amount;
    return map;
  }
}
